package JAVA300.第七章数组;
/*
测试常用方法--学会看api
 */
public class TestStringMethod {
    public static void main(String[] args) {
        String str1 = "core JAVA";
        String str2 = " Core JAVA ";
      //the index of the {@code char} value
        System.out.println(str1.charAt(3));//e
      //the index of the first occurrence of the specified substring  return -1 if not find
        System.out.println(str1.indexOf("JAVA"));//5
        //截取字符串--包含中间的空格
        String s = str1.substring(4);
        System.out.println(s);

        s = str1.substring(4,6);
        System.out.println(s);

        //取出首位空格，中间不可取
        System.out.println(str2.trim());


    }
}
